import { createI18n } from 'vue-i18n'

// 导入语言文件
const messages = {
  'zh-CN': {
    common: {
      welcome: '欢迎使用',
      appUnavailable: '应用不可用',
      appUnkonwError: '应用不可用',
    },
    chat: {
      newChat: '新对话',
      newChatDefaultName: '新的对话',
      openingStatementTitle: '对话开场白',
      powerBy: 'Powered by',
      prompt: '提示词',
      privatePromptConfigTitle: '对话设置',
      publicPromptConfigTitle: '对话前提示词',
      configStatusDes: '开始前，您可以修改对话设置',
      configDisabled: '此次会话已使用上次会话表单',
      startChat: '开始对话',
      privacyPolicyLeft: '请阅读由该应用开发者提供的',
      privacyPolicyMiddle: '隐私政策',
      privacyPolicyRight: '。',
    },
    operation: {
      confirm: '确认',
      cancel: '取消',
      clear: '清空',
      save: '保存',
      edit: '编辑',
      refresh: '重新开始',
      search: '搜索',
      send: '发送',
      lineBreak: '换行',
      like: '赞同',
      dislike: '反对',
      ok: '好的',
    },
    errorMessage: {
      valueOfVarRequired: '变量值必填',
      waitForResponse: '请等待上条信息响应完成',
    },
    variableTable: {
      optional: '可选',
    },
  },
  'en': {
    common: {
      welcome: 'Welcome to use',
      appUnavailable: 'App is unavailable',
      appUnkonwError: 'App is unavailable',
    },
    chat: {
      newChat: 'New chat',
      newChatDefaultName: 'New conversation',
      openingStatementTitle: 'Opening statement',
      powerBy: 'Powered by',
      prompt: 'Prompt',
      privatePromptConfigTitle: 'Conversation settings',
      publicPromptConfigTitle: 'Initial Prompt',
      configStatusDes: 'Before start, you can modify conversation settings',
      configDisabled: 'Previous session settings have been used for this session.',
      startChat: 'Start Chat',
      privacyPolicyLeft: 'Please read the ',
      privacyPolicyMiddle: 'privacy policy',
      privacyPolicyRight: ' provided by the app developer.',
    },
    operation: {
      confirm: 'Confirm',
      cancel: 'Cancel',
      clear: 'Clear',
      save: 'Save',
      edit: 'Edit',
      refresh: 'Restart',
      search: 'Search',
      send: 'Send',
      lineBreak: 'Line break',
      like: 'like',
      dislike: 'dislike',
      ok: 'OK',
    },
    errorMessage: {
      valueOfVarRequired: 'Variables value can not be empty',
      waitForResponse: 'Please wait for the response to the previous message to complete.',
    },
    variableTable: {
      optional: 'Optional',
    },
  },
}

// 创建 i18n 实例
const i18n = createI18n({
  legacy: false, // 使用 Composition API 模式
  locale: 'zh-CN', // 默认语言
  fallbackLocale: 'en', // 回退语言
  messages,
})

export default i18n 